import React from 'react'


type PropTypes = {
  name: string,
  size?: number,
  color?: string,
  onClick?: any
}
function Icon(props: PropTypes) {
  return (
    <i 
      className={`iconfont icon-${props.name}`} 
      style={{color: props.color, fontSize: `${props.size}px`}}
      onClick = {
        () => {
          props.onClick()
        }
      }
    />
  )
}

Icon.defaultProps = {
  size: 16,
  name: "black",
  onClick: () => {}
}
export default Icon
